Repository navigation
fix(app-showcase): give the task Grid rowColor a colours map the renderer actually resolves - #18787
Merged
Merged
Conversation
…hat the renderer actually resolves
`rowColor: { field: 'priority' }` parsed and published clean and coloured
nothing: objectui `plugin-grid`'s `useRowColor` returns before it reads a
record when `colors` is absent.
The map's values are colour NAMES rather than the hexes the `priority` field
declares on its own options, because `colorToClass` resolves only its
`COLOR_TO_CLASS` vocabulary and `bg-*` pass-throughs and returns `undefined`
for anything else — a hex would clear the resolver's guard, silence the
author-time diagnostic, and still colour no row. Each name is the vocabulary
entry nearest to the colour the option already declares.
Claude-Session: https://claude.ai/code/session_017ef78bLdybu3AffehKkhfk
Co-authored-by: Claude <noreply@anthropic.com>
Two arms: the shipped ADR-0078 completeness rule must report no `view/row-color-without-colors` finding for this stack, and every authored row colour must be a value `colorToClass` can resolve — the half no shipped rule sees, where a hex silences the first arm and still colours nothing. Claude-Session: https://claude.ai/code/session_017ef78bLdybu3AffehKkhfk Co-authored-by: Claude <noreply@anthropic.com>
os-try-charles
marked this pull request as ready for review
September 17, 2026 21:04
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #15100
examples/app-showcase's task Grid view declaredrowColor: { field: 'priority' }with nocolorsmap, so objectuiplugin-grid'suseRowColorreturned before it read a record and everyrow kept the default background, while the metadata parsed, validated and published clean.
The card's stated reason for not fixing this was half right, and the other half is the point
The card says the map "is not mechanical: which colour each
priorityvalue should get is a designchoice … not a shape pinned by existing evidence". The evidence does exist — the
priorityfielddeclares a colour per option in the same app (
src/data/objects/task.object.ts:low #94A3B8,medium #3B82F6,high #F59E0B,urgent #EF4444) — but copying those hexes straight acrosswould have been the same defect one layer deeper.
Read at
objectstack-ai/objectui@cfcc17d9,packages/plugin-grid/src/useRowColor.ts:colorToClasshands a value that already beginsbg-through untouched, otherwise looks thelower-cased value up in its own
COLOR_TO_CLASSmap of colour names, and returnsundefinedfor anything else. It never fabricates a class string — the sibling module
packages/plugin-detail/src/headerColor.tsrecords why in measured detail: Tailwind v4 has noruntime, it builds the stylesheet by scanning source text for complete class tokens, so a
concatenated
bg-+ value names no rule at all.A hex map therefore clears the resolver's
if (!config?.field || !config.colors)guard, silencesthe author-time diagnostic
view/row-color-without-colors, and still colours no row — the defectmade invisible rather than fixed. Demonstrated below (ablation leg B).
So the values are colour names, chosen by one stated uniform rule rather than by taste: each is
the entry of the renderer's own vocabulary nearest to the colour the option already declares,
measured in OKLab against this workspace's pinned
tailwindcss@4.3.3palette over every shade ofevery vocabulary family.
Every winner is its own family's shade at the hue the field already declares, so no palette was
invented here. It also answers the full-row contrast question: the renderer paints the
-100tintof the name (
red->bg-red-100), never the saturated fill — the desaturation is the renderer's,not a judgement call made in the app.
Evidence
Author-time diagnostic, before and after — tree
objectstack-issue-15100, the branch head,pnpm --filter @objectstack/example-showcase validate:view/row-color-without-colors922923b8acontent)view container [0] › listViews.gridExactly one advisory moved. The rule is WARNING severity, so
validateexits 0 either way — whichis why the new pin asserts on the findings, not on the exit code.
Regression pin —
examples/app-showcase/test/inert-wirings.test.ts, the file whose charter isthis app's declared-but-inert wirings. Two arms: the shipped ADR-0078 rule
(
validateFunctionalCompleteness, aliased topackages/lint/srcby this app's vitest config) mustreport no
view/row-color-without-colorsfinding, and every authored row colour must be a valuecolorToClasscan resolve. The vocabulary itself is deliberately not transcribed into thisrepo — a hand-copy of another repo's 23-entry map is a second opinion that drifts; the arm asserts
the shape rule that separates a resolvable value from a hex.
Reverse verification, run from the committed state, each leg proved on disk before it was read,
restored with
git checkout HEAD --on the target path and the restored blob hash compared againstHEAD:examples/app-showcase/src/ui/views/task.view.ts(cb97b5e23…, matched):colorsmap (the card's original shape)reports no view/row-color-without-colors findingHow far this could be proved here
The renderer lives in
objectstack-ai/objectui, which this container can read but not run — nonode_modulesthere, and this session has no write access to it. So the renderer half is asource reading at a named revision (
cfcc17d9), plus a mechanical membership check run againstthat file's real bytes: each of the four declared hexes resolves to
undefinedthroughcolorToClass, each of the four authored names resolves to abg-NAME-100class. It is not arendered screenshot, and is not claimed as one.
One thing that reading does settle:
bg-slate-100,bg-blue-100,bg-amber-100andbg-red-100are complete literals inside
packages/plugin-grid/src/useRowColor.ts, andapps/console/src/index.cssscanspackages/plugin-grid/src/**, so those four classes are in thecompiled stylesheet by the same mechanism the renderer relies on.
Changeset
None — measured, not defaulted.
@objectstack/example-showcasedeclares"private": true, and aprobe over all 70 non-private workspace packages grepped every root their
files[]actually shipsfor a symbol unique to this diff (
urgent: 'red'): 0 hits. Positive control on the same probe,RowColorConfigSchema: 4 hits, includingpackages/spec/dist/view.zod-*.d.ts, so the probe doesreach shipped
dist. Nothing published moves.Acceptance notes
packages/lint/src/showcase-shape.fixtures.tsstill carries the inertrowColor: { field: 'priority' }line. That is deliberate and untouched: its header records the 2026-08-13 maintainer ruling that
it must not be re-synced with the live app. Both the card and triage name that boundary.
RowColorConfigSchemais unchanged — makingcolorsrequired is spec-side and belongs to[finding]
rowColor.colorsis optional in the schema but required by the only renderer —rowColor: { field }alone is a parse-clean no-op #14111, which is not addressed here and remains open on its own terms.RowColorConfigSchema.colorsdescribes itself as a "Map of field value to color (hex/token)", while the only renderer resolves
neither a hex nor an arbitrary token. An author who follows that description — or who copies the
colours the same object's own select field declares — writes metadata the runtime silently drops,
and the diagnostic added for [finding]
rowColor.colorsis optional in the schema but required by the only renderer —rowColor: { field }alone is a parse-clean no-op #14111 reports presence only, so it goes on reading green.Generated by Claude Code